package com.sirui.x.learnBoot.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sirui.x.learnBoot.global.MsgException;

/**
 * @ControllerAdvice  和 @ExceptionHandler处理全局异常
 */
@RestController
public class OrderController {


    @GetMapping("test")
    public String test(){
        long start = System.currentTimeMillis();
        if(start % 2 == 0){
            throw new MsgException("test.....");
        }
        return String.valueOf(System.currentTimeMillis());
    }

}
